package com.xiaofeng.pochi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaofeng.pochi.common.Page;
import com.xiaofeng.pochi.pojo.ShopBrand;
import com.xiaofeng.pochi.pojo.ShopPack;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/08/13/22:29
 * @Description:
 */
@Component
public interface ShopPackMapper extends BaseMapper<ShopPack> {
    /**
     * 保存
     * @param shopPack
     */
    void save(ShopPack shopPack);

    /**
     * 修改
     * @param shopPack
     */
    void update(ShopPack shopPack);


    /**
     * 删除
     * @param id
     */
    void delete(Long id);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    ShopPack get(Long id);

    /**
     * 分页查询
     * @param page
     * @return
     */
    List<ShopPack> getByPage(Page<ShopPack> page);

    /**
     * 查询总数
     * @param page
     * @return
     */
    Integer countByPage(Page<ShopPack> page);

    void updateProductCount(@Param("packCode") Long packCode, @Param("size")int size);
}
